package lab02.test06;

/**
 * Created by 婷婷 on 2017/10/15.
 */
public class Ladder {

    //2)	Ladder类具有类型double的上底、下底、高、面积属性，具有返回面积的功能
    //属性：上底、下底、高、面积
    private double upSide;
    private double downSide;
    private double high;
    private double area;

    //构造一个有参函数
    public Ladder(double upSide, double downSide, double high) {
        this.upSide = upSide;
        this.downSide = downSide;
        this.high = high;

    }

    //求梯形面积的方法
    public double area(){
        area = (upSide+downSide)*high/2;
        return area;
    }
}
